﻿<%@ Page Title="" Language="C#" MasterPageFile="~/paginaPrincipala.Master" AutoEventWireup="true"
    CodeBehind="onlineContent.aspx.cs" Inherits="RSSReader.pageswithContent.OnlineContent" %>

<asp:Content ID="onlineArticles" ContentPlaceHolderID="mainContent" runat="server">
    <asp:ObjectDataSource ID="ObjectDataSourceForOnlineArticles" runat="server" TypeName="RSSReader.classesCustom.UserDataHandler"
        SelectMethod="getUserCustomXMLArticles" StartRowIndexParameterName="startRowIndex"
        MaximumRowsParameterName="maximumRows" SelectCountMethod="getUserCustomXMLArticlesCount"
        EnablePaging="True" OnObjectCreating="ObjectDataSourceForOnlineArticles_ObjectCreating">
    </asp:ObjectDataSource>

     <h3>
        Articole aparute recent online: 
    </h3>

    <div id="box1">
        <asp:GridView ID="articlesGrid" runat="server" DataSourceID="ObjectDataSourceForOnlineArticles"
            DataKeyNames="ID" EnableModelValidation="True" AutoGenerateColumns="False" AllowSorting="True"
            AllowPaging="True" PageSize="8" BorderStyle="None" BackColor="White" ForeColor="Black"
            GridLines="Vertical">
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:TemplateField SortExpression="logo">
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("logo") %>' CssClass="logoimg" />
                    </ItemTemplate>
                    <ItemStyle Width="70px" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="domeniu">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("category") %>' Height="25"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="titlu articol">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("title") %>' Style="overflow-y: auto;"
                            Height="25"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="datare">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("pubdate") %>' Style="overflow-y: auto;
                            overflow-x: hidden" Height="25">
                        </asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
    </div>
    <div id="box2">
        <asp:ObjectDataSource ID="ObjectDataSourceArticleDetail" runat="server" SelectMethod="getUserCustomXMLArticleById"
            TypeName="RSSReader.classesCustom.UserDataHandler" OnObjectCreating="ObjectDataSourceArticleDetail_ObjectCreating">
            <SelectParameters>
                <asp:ControlParameter ControlID="articlesGrid" DefaultValue="1" Name="ID" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSourceArticleDetail"
            EnableModelValidation="True" Width="100%">
            <ItemTemplate>
                <table width="100%">
                    <tr>
                        <td width="20%"  class="centercell" >
                            <asp:Label ID="category" runat="server" 
                                Text='<%# Bind("category") %>' CssClass="centercell" />
                        </td>
                        <td width="70%" 
                            style="border-top: thin solid black; border-bottom: thin solid black;" 
                            class="centercell">
                            <asp:Label ID="title" runat="server" Text='<%# Bind("title") %>' Font-Bold="True" />
                        </td>
                        <td width="10%" >
                            <asp:Label ID="pubdate" runat="server" Text='<%# Bind("pubdate") %>'
                                Width="100%" />
                        </td>
                    </tr>
                    <tr>
                        <td width="70px" class="centercell" >
                            <asp:Image ID="logoImage" runat="server" ImageUrl='<%# Bind("logo") %>' CssClass="logoimg" />
                        </td>
                        <td colspan="2">
                            <asp:Panel ID="summaryPanel" runat="server" Width="100%" CssClass="centercell">
                                <asp:Label ID="description" runat="server" Text='<%# Bind("description") %>' />
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" width="70px" style="border-top: thin solid black; border-bottom: thin solid black;">
                            <asp:Label ID="fullArticleLabel" runat="server" Text='<%# Bind("fullArticle") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td width="49%" class="rightcell">
                            <br />
                            <asp:Image ID="Image2" runat="server" ImageUrl='<%# Bind("logo") %>' CssClass="logoimg" />
                            <asp:HyperLink ID="weblink" runat="server"
                                NavigateUrl='<%# Bind("weblink") %>' Target="_blank" 
                                Text="Vezi articolul in varianta originala" />
                        </td>
                        <td width="2%">
                            &nbsp
                        </td>
                        <td width="49%" class="leftcell" >
                            <asp:Button ID="saveButton" runat="server" Text="Salveaza Articol" OnClick="saveButton_Click" />
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:FormView>
        <br />
    </div>
</asp:Content>
